package com.zhongjinkang.rhythm.viewModel

import android.graphics.Bitmap
import android.graphics.BitmapFactory
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.zhongjinkang.rhythm.Model.BaseModel
import com.zhongjinkang.rhythm.Model.HttpImageModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.net.URL

class DetailImageViewModel : BaseViewModel<HttpImageModel>(HttpImageModel()) {
    var bitmap = MutableLiveData<Bitmap?>()

    init {

    }

    fun addUrl(urlPath: String) {
        viewModelScope.launch {

              bitmap.value=model?.loadBitmap(urlPath)

        }
    }




}